home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 7: Sunsite / Linux Cubed Series 7 - Sunsite Vol 1.iso / system / network / samba / patches / samba-1.021 / samba-1
Encoding:
Text File  |  1995-10-30  |  13.8 KB  |  462 lines

  1. diff -u -r --new-file last-version/docs/Speed.txt samba-1.9.14p1/docs/Speed.txt
  2. --- last-version/docs/Speed.txt    Mon Jul  3 18:37:33 1995
  3. +++ samba-1.9.14p1/docs/Speed.txt    Sun Oct 22 12:21:48 1995
  4. @@ -101,6 +101,18 @@
  5.  filesystems, but could be quite high even on local disks.
  6.  
  7.  
  8. +SHARE MODES
  9. +-----------
  10. +
  11. +Some people find that opening files is very slow. This is often
  12. +because of the "share modes" code needed to fully implement the dos
  13. +share modes stuff. You can disable this code using "share modes =
  14. +no". This will gain you a lot in opening and closing files but will
  15. +mean that (in some cases) the system won't force a second user of a
  16. +file to open the file read-only if the first has it open
  17. +read-write. For many applications that do their own locking this
  18. +doesn't matter, but for some it may.
  19. +
  20.  LOG LEVEL
  21.  ---------
  22.  
  23. diff -u -r --new-file last-version/docs/Support.txt samba-1.9.14p1/docs/Support.txt
  24. --- last-version/docs/Support.txt    Fri Jun 23 19:52:09 1995
  25. +++ samba-1.9.14p1/docs/Support.txt    Mon Oct 30 17:30:07 1995
  26. @@ -188,3 +188,27 @@
  27.  Samba experience: Linux, DEC ULTRIX <=> WFWG 3.11, Windows NT 3.5
  28.  Specializing in World Wide Web related UNIX-to-PC connectivity.
  29.  ------------------------------------------------------------------------------
  30. +
  31. +------------------------------------------------------------------------------
  32. +FORT COLLINS, CO - USA
  33. +
  34. +Granite Computing Solutions
  35. +ATTN: Brian Grossman
  36. +Box 270103
  37. +Fort Collins, CO  80527-0103
  38. +U.S.A.
  39. +(970) 225-2370
  40. +granite@fortnet.org
  41. +
  42. +Information services, including WfWG, NT, Apple <=> Unix interoperability.
  43. +
  44. +Our standard advertisement says:
  45. +
  46. +>               Unix workstations, servers and custom systems           <
  47. +>>              WWW and Unix education                                   <<
  48. +>>>             Enterprise and departmental computing solutions           <<<
  49. +>>>             Backup & restore                                          <<<
  50. +>>              Software forensics                                       <<
  51. +>               Data translation                                        <
  52. +------------------------------------------------------------------------------
  53. +
  54. diff -u -r --new-file last-version/source/change-log samba-1.9.14p1/source/change-log
  55. --- last-version/source/change-log    Fri Sep 22 10:39:15 1995
  56. +++ samba-1.9.14p1/source/change-log    Mon Oct 30 17:28:11 1995
  57. @@ -1589,7 +1589,25 @@
  58.      - more japanese extensions patches from fujita@ainix.isac.co.jp 
  59.      - released alpha20
  60.      - added force_user to conn struct
  61. -    
  62. +
  63. +
  64. +2.0.0:
  65. +        - removed bcast override from workgroup announce in nmbd
  66. +    - aix patch, added NO_SYSMOUNTH, from 
  67. +    lionel leston <102624.346@compuserve.com>    
  68. +    - quick fix in lp_string() to try and stop some core dumps
  69. +    - added uid cache in connections structure 
  70. +    to make user level security faster
  71. +    - changed dos_mode() to show read-only on read-only shares only if
  72. +    user w bit not set
  73. +    - added check to stop exit_server() looping
  74. +    - core dump fix in string_sub()
  75. +    - fix client bug for long dirs in NT1 mode. 
  76. +    Thanks to Erwin Authried (erwin@ws1.atv.tuwien.ac.at)
  77. +    - switched to a safer (but probably slower) readbraw implementation
  78. +
  79. +
  80. +
  81.  
  82.  ==========
  83.  todo:
  84. diff -u -r --new-file last-version/source/client.c samba-1.9.14p1/source/client.c
  85. --- last-version/source/client.c    Thu Sep 21 20:41:37 1995
  86. +++ samba-1.9.14p1/source/client.c    Mon Oct 30 17:13:49 1995
  87. @@ -845,7 +845,8 @@
  88.          {
  89.          case 260:
  90.            ff_resume_key =0;
  91. -          strcpy(mask,p+ff_lastname+94);
  92. +          StrnCpy(mask,p+ff_lastname,resp_data_len-ff_lastname);
  93. +          /* strcpy(mask,p+ff_lastname+94); */
  94.            break;
  95.          case 1:
  96.            strcpy(mask,p + ff_lastname + 1);
  97. diff -u -r --new-file last-version/source/fault.c samba-1.9.14p1/source/fault.c
  98. --- last-version/source/fault.c    Sat Sep  2 17:44:08 1995
  99. +++ samba-1.9.14p1/source/fault.c    Mon Oct 30 17:15:35 1995
  100. @@ -76,6 +76,7 @@
  101.  void fault_setup(void (*fn)())
  102.  {
  103.    cont_fn = fn;
  104. +
  105.  #ifdef SIGSEGV
  106.    signal(SIGSEGV,SIGNAL_CAST sig_fault);
  107.  #endif
  108. @@ -83,3 +84,6 @@
  109.    signal(SIGBUS,SIGNAL_CAST sig_fault);
  110.  #endif
  111.  }
  112. +
  113. +
  114. +
  115. diff -u -r --new-file last-version/source/includes.h samba-1.9.14p1/source/includes.h
  116. --- last-version/source/includes.h    Thu Sep 21 20:49:47 1995
  117. +++ samba-1.9.14p1/source/includes.h    Sun Oct 22 13:39:14 1995
  118. @@ -57,6 +57,10 @@
  119.  #define NO_UNISTDH
  120.  #endif
  121.  
  122. +#ifdef AIX
  123. +#define NO_SYSMOUNTH
  124. +#endif
  125. +
  126.  #ifdef M88K_R3
  127.  #define SVR3H
  128.  #define NO_RESOURCEH
  129. diff -u -r --new-file last-version/source/loadparm.c samba-1.9.14p1/source/loadparm.c
  130. --- last-version/source/loadparm.c    Sun Sep 17 09:53:17 1995
  131. +++ samba-1.9.14p1/source/loadparm.c    Sun Oct 22 11:58:56 1995
  132. @@ -583,7 +583,11 @@
  133.    ret = &bufs[next][0];
  134.    next = (next+1)%10;
  135.  
  136. -  StrnCpy(ret,s,sizeof(pstring)-1);
  137. +  if (!s) 
  138. +    *ret = 0;
  139. +  else
  140. +    StrnCpy(ret,s,sizeof(pstring)-1);
  141. +
  142.    standard_sub_basic(ret);
  143.    return(ret);
  144.  }
  145. diff -u -r --new-file last-version/source/local.h samba-1.9.14p1/source/local.h
  146. --- last-version/source/local.h    Thu Sep 14 10:32:52 1995
  147. +++ samba-1.9.14p1/source/local.h    Sun Oct 22 13:51:03 1995
  148. @@ -105,6 +105,9 @@
  149.  #define PAGER "more"
  150.  #endif
  151.  
  152. +/* the size of the uid cache used to reduce valid user checks */
  153. +#define UID_CACHE_SIZE 4
  154. +
  155.  /* the following control timings of various actions. Don't change 
  156.     them unless you know what you are doing. These are all in seconds */
  157.  #define DEFAULT_SMBD_TIMEOUT (60*60*24*7)
  158. diff -u -r --new-file last-version/source/nameserv.c samba-1.9.14p1/source/nameserv.c
  159. --- last-version/source/nameserv.c    Tue Sep 12 15:57:11 1995
  160. +++ samba-1.9.14p1/source/nameserv.c    Fri Sep 22 17:39:32 1995
  161. @@ -1464,7 +1464,7 @@
  162.      if (names[i].valid) {
  163.        if (names[i].name[0] == '*') {
  164.      StrnCpy(names[i].name,group,15);
  165. -    names[i].ip = names[i].master_ip = ip;
  166. +    names[i].master_ip = ip;
  167.      names[i].found_master = True;
  168.      names[i].count=0;
  169.      announce_host(i,myname,comment);
  170. @@ -1475,7 +1475,7 @@
  171.      for (j=i;j<num_names;j++)
  172.        if (names[j].valid && names[j].isgroup && names[i].found_master && 
  173.            name_equal(names[i].name,group,0,0)) return;
  174. -    names[i].ip = names[i].master_ip = ip;
  175. +    names[i].master_ip = ip;
  176.      names[i].found_master = True;
  177.      names[i].count=0;
  178.      announce_host(i,myname,comment);
  179. diff -u -r --new-file last-version/source/reply.c samba-1.9.14p1/source/reply.c
  180. --- last-version/source/reply.c    Thu Sep 21 20:49:48 1995
  181. +++ samba-1.9.14p1/source/reply.c    Mon Oct 30 17:31:07 1995
  182. @@ -1000,7 +1000,7 @@
  183.      close_file(fnum);
  184.      return(ERROR(ERRDOS,ERRnoaccess));
  185.    }
  186. -  
  187. +
  188.    outsize = set_message(outbuf,15,0,True);
  189.    CVAL(outbuf,smb_vwv0) = smb_com2;
  190.    SSVAL(outbuf,smb_vwv1,(chain_size+outsize)-4);
  191. @@ -1157,6 +1157,8 @@
  192.    struct stat sbuf;
  193.    int fmode;
  194.  
  195. +  if (!CAN_WRITE(cnum)) return(False);
  196. +
  197.    if (sys_lstat(fname,&sbuf) != 0) return(False);
  198.    fmode = dos_mode(cnum,fname,&sbuf);
  199.    if (fmode & aDIR) return(False);
  200. @@ -1264,7 +1266,6 @@
  201.    int ret=0;
  202.    int fd;
  203.    char *fname;
  204. -  int predict=0;
  205.  
  206.    cnum = SVAL(inbuf,smb_tid);
  207.    fnum = GETFNUM(inbuf,smb_vwv0);
  208. @@ -1315,16 +1316,28 @@
  209.         fnum,cnum,startpos,
  210.         maxcount,mincount,nread));
  211.    
  212. -  _smb_setlen(header,nread);
  213. +#if UNSAFE_READRAW
  214. +  {
  215. +    int predict=0;
  216. +    _smb_setlen(header,nread);
  217. +
  218. +    if (!Files[fnum].can_write)
  219. +      predict = read_predict(fd,startpos,header+4,NULL,nread);
  220.  
  221. -  if (!Files[fnum].can_write)
  222. -    predict = read_predict(fd,startpos,header+4,NULL,nread);
  223. +    if ((nread-predict) > 0)
  224. +      seek_file(fnum,startpos + predict);
  225. +    
  226. +    ret = transfer_file(fd,Client,nread-predict,header,4+predict,
  227. +            startpos+predict);
  228. +  }
  229. +#else
  230. +  ret = read_file(fnum,header+4,startpos,nread,nread,-1,False);
  231. +  if (ret < mincount) ret = 0;
  232.  
  233. -  if ((nread-predict) > 0)
  234. -    seek_file(fnum,startpos + predict);
  235. +  _smb_setlen(header,ret);
  236. +  transfer_file(0,Client,0,header,4+ret,0);
  237. +#endif
  238.  
  239. -  ret = transfer_file(fd,Client,nread-predict,header,4+predict,
  240. -              startpos+predict);
  241.  
  242.    if (ret != nread+4)
  243.      DEBUG(0,("ERROR: file read failure on %s at %d for %d bytes (%d)\n",
  244. @@ -2439,6 +2452,8 @@
  245.  {
  246.    struct stat sbuf;
  247.    int fmode;
  248. +
  249. +  if (!CAN_WRITE(cnum)) return(False);
  250.  
  251.    if (sys_lstat(fname,&sbuf) != 0) return(False);
  252.    fmode = dos_mode(cnum,fname,&sbuf);
  253. diff -u -r --new-file last-version/source/server.c samba-1.9.14p1/source/server.c
  254. --- last-version/source/server.c    Fri Sep 22 10:39:21 1995
  255. +++ samba-1.9.14p1/source/server.c    Mon Oct 30 17:08:57 1995
  256. @@ -151,9 +151,18 @@
  257.  {
  258.    int result = 0;
  259.  
  260. -  if (!CAN_WRITE(cnum))
  261. +#if OLD_DOS_MODE
  262. +  if (!CAN_WRITE(cnum) || !((sbuf->st_mode & S_IWOTH) ||
  263. +                Connections[cnum].admin_user ||
  264. +                ((sbuf->st_mode & S_IWUSR) && 
  265. +                 Connections[cnum].uid==sbuf->st_uid) ||
  266. +                ((sbuf->st_mode & S_IWGRP) && 
  267. +                 in_group(sbuf->st_gid,Connections[cnum].gid,
  268. +                      Connections[cnum].ngroups,
  269. +                      Connections[cnum].igroups))))
  270.      result |= aRONLY;
  271. -  else
  272. +#else
  273. +  if (CAN_WRITE(cnum)) {
  274.      if (!((sbuf->st_mode & S_IWOTH) ||
  275.        Connections[cnum].admin_user ||
  276.        ((sbuf->st_mode & S_IWUSR) && Connections[cnum].uid==sbuf->st_uid) ||
  277. @@ -161,6 +170,11 @@
  278.         in_group(sbuf->st_gid,Connections[cnum].gid,
  279.              Connections[cnum].ngroups,Connections[cnum].igroups))))
  280.        result |= aRONLY;
  281. +  } else {
  282. +    if ((sbuf->st_mode & S_IWUSR) == 0)
  283. +      result |= aRONLY;
  284. +  }
  285. +#endif
  286.  
  287.    if ((sbuf->st_mode & S_IXUSR) != 0)
  288.      result |= aARCH;
  289. @@ -1224,7 +1238,7 @@
  290.    }
  291.  
  292.    if (flags != O_RDONLY && file_existed && 
  293. -      IS_DOS_READONLY(dos_mode(cnum,fname,&sbuf))) {
  294. +      (!CAN_WRITE(cnum) || IS_DOS_READONLY(dos_mode(cnum,fname,&sbuf)))) {
  295.      if (!fcbopen) {
  296.        errno = EACCES;
  297.        return;
  298. @@ -1578,6 +1592,26 @@
  299.    return(ret);
  300.  }
  301.  
  302. +/*******************************************************************
  303. +check if a username is OK
  304. +********************************************************************/
  305. +static BOOL check_user_ok(int cnum,user_struct *vuser,int snum)
  306. +{
  307. +  int i;
  308. +  for (i=0;i<Connections[cnum].uid_cache.entries;i++)
  309. +    if (Connections[cnum].uid_cache.list[i] == vuser->uid) return(True);
  310. +
  311. +  if (!user_ok(vuser->name,snum)) return(False);
  312. +
  313. +  i = Connections[cnum].uid_cache.entries % UID_CACHE_SIZE;
  314. +  Connections[cnum].uid_cache.list[i] = vuser->uid;
  315. +
  316. +  if (Connections[cnum].uid_cache.entries < UID_CACHE_SIZE)
  317. +    Connections[cnum].uid_cache.entries++;
  318. +
  319. +  return(True);
  320. +}
  321. +
  322.  
  323.  /****************************************************************************
  324.    become the user of a connection number
  325. @@ -1599,7 +1633,7 @@
  326.    if (Connections[cnum].force_user || 
  327.        lp_security() == SEC_SHARE ||
  328.        !(vuser = get_valid_user_struct(uid)) ||
  329. -      !user_ok(vuser->name,snum)) {
  330. +      !check_user_ok(cnum,vuser,snum)) {
  331.      uid = Connections[cnum].uid;
  332.      gid = Connections[cnum].gid;
  333.      groups = Connections[cnum].groups;
  334. @@ -2364,6 +2398,7 @@
  335.      }
  336.  
  337.    pcon = &Connections[cnum];
  338. +  bzero((char *)pcon,sizeof(*pcon));
  339.  
  340.    /* find out some info about the user */
  341.    pass = Get_Pwnam(user,True);
  342. @@ -2376,11 +2411,20 @@
  343.  
  344.    pcon->read_only = lp_readonly(snum);
  345.  
  346. -  if (user_in_list(user,lp_readlist(snum)))
  347. -    pcon->read_only = True;
  348. +  {
  349. +    pstring list;
  350. +    StrnCpy(list,lp_readlist(snum),sizeof(pstring)-1);
  351. +    string_sub(list,"%S",service);
  352. +
  353. +    if (user_in_list(user,list))
  354. +      pcon->read_only = True;
  355. +
  356. +    StrnCpy(list,lp_writelist(snum),sizeof(pstring)-1);
  357. +    string_sub(list,"%S",service);
  358.  
  359. -  if (user_in_list(user,lp_writelist(snum)))
  360. -    pcon->read_only = False;    
  361. +    if (user_in_list(user,list))
  362. +      pcon->read_only = False;    
  363. +  }
  364.  
  365.    /* admin user check */
  366.    if (user_in_list(user,lp_admin_users(snum)) &&
  367. @@ -3171,6 +3215,8 @@
  368.    chown(dname,getuid(),getgid());
  369.    chmod(dname,0700);
  370.    if (chdir(dname)) return(False);
  371. +  umask(~(0700));
  372. +
  373.  #ifndef NO_GETRLIMIT
  374.  #ifdef RLIMIT_CORE
  375.    {
  376. @@ -3179,11 +3225,12 @@
  377.      rlp.rlim_cur = MAX(4*1024*1024,rlp.rlim_cur);
  378.      setrlimit(RLIMIT_CORE, &rlp);
  379.      getrlimit(RLIMIT_CORE, &rlp);
  380. -    DEBUG(0,("Core limits now %d %d\n",rlp.rlim_cur,rlp.rlim_max));
  381. +    DEBUG(3,("Core limits now %d %d\n",rlp.rlim_cur,rlp.rlim_max));
  382.    }
  383.  #endif
  384.  #endif
  385. -  umask(~(0700));
  386. +
  387. +
  388.    DEBUG(0,("Dumping core in %s\n",dname));
  389.    return(True);
  390.  }
  391. @@ -3194,7 +3241,12 @@
  392.  ****************************************************************************/
  393.  void exit_server(char *reason)
  394.  {
  395. +  static int firsttime=1;
  396.    int i;
  397. +
  398. +  if (!firsttime) exit(0);
  399. +  firsttime = 0;
  400. +
  401.    if (done_become_user != -1)
  402.      unbecome_user();
  403.    DEBUG(1,("Closing connections\n"));
  404. @@ -3715,7 +3767,7 @@
  405.  
  406.        /* check for socket failure */
  407.        if (errno == EBADF) {
  408. -        DEBUG(2,("%s Bad file descriptor - exiting\n",timestring()));
  409. +        DEBUG(3,("%s Bad file descriptor - exiting\n",timestring()));
  410.          return;
  411.        }
  412.  
  413. diff -u -r --new-file last-version/source/smb.h samba-1.9.14p1/source/smb.h
  414. --- last-version/source/smb.h    Fri Sep 22 10:35:42 1995
  415. +++ samba-1.9.14p1/source/smb.h    Sun Oct 22 13:49:05 1995
  416. @@ -248,12 +248,19 @@
  417.      char *name;
  418.      } files_struct;
  419.  
  420. +
  421. +struct uid_cache {
  422. +  int entries;
  423. +  int list[UID_CACHE_SIZE];
  424. +};
  425. +
  426.  typedef struct
  427.  {
  428.    int service;
  429.    BOOL force_user;
  430.    int uid; /* uid of user who *opened* this connection */
  431.    int gid; /* gid of user who *opened* this connection */
  432. +  struct uid_cache uid_cache;
  433.    void *dirptr;
  434.    BOOL open;
  435.    BOOL printer;
  436. diff -u -r --new-file last-version/source/util.c samba-1.9.14p1/source/util.c
  437. --- last-version/source/util.c    Thu Sep 21 21:05:13 1995
  438. +++ samba-1.9.14p1/source/util.c    Mon Oct 23 20:19:33 1995
  439. @@ -2632,9 +2632,13 @@
  440.  {
  441.    BOOL ret = False;
  442.    char *p;
  443. -  int ls = strlen(s);
  444. -  int lp = strlen(pattern);
  445. -  int li = strlen(insert);
  446. +  int ls,lp,li;
  447. +
  448. +  if (!insert || !pattern || !s) return(False);
  449. +
  450. +  ls = strlen(s);
  451. +  lp = strlen(pattern);
  452. +  li = strlen(insert);
  453.  
  454.    if (!*pattern) return(False);
  455.  
  456. diff -u -r --new-file last-version/source/version.h samba-1.9.14p1/source/version.h
  457. --- last-version/source/version.h    Fri Sep 22 10:40:47 1995
  458. +++ samba-1.9.14p1/source/version.h    Mon Oct 30 17:32:32 1995
  459. @@ -1 +1 @@
  460. -#define VERSION "1.9.14"
  461. +#define VERSION "1.9.14p1"
  462.